<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
</head>
<script type="text/javascript">
function createTrade(){
	//alert('${appid}');
	window.location.href="${ctx}/sPageParamTrade/jumpCreatePage?pageId=${pageId}";
}

function deleteTrade(){
	if(p_del()){
    $.ajax({
        url:"${ctx}/sPageParamTrade/deleteSpageParamTrade?tradeid="+tradeid,
        type: "POST",      
        dataType:"json",
        async: false,
        success: function(data) {
        	if(data.flag>0){
	            alert("删除成功！");	
	            window.location.reload();
        	}
/* 	          $.each(data, function(index, element) {
             window.location.reload();
          }); */
        },
        error: function() {
          alert("error");
        }
      });
	}else{
		alert("请选择要删除的数据！");
	}
}

function updateTrade(){
	window.location.href="${ctx}/sPageParamTrade/jumpEditPage?tradeid="+tradeid;

}

function p_del() { 
	var msg = "您真的确定要删除吗？\n\n请确认！"; 
	if (confirm(msg)==true){ 
	return true; 
	}else{ 
	return false; 
	} 
} 
</script>
<body   onload="">
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
          请输入查询条件
      </h3>
   </div>
   <div class="panel-body">
<form class="form-horizontal" role="form" method="post" action="${pageContext.request.contextPath}/sPageParamTrade/jumpListPage.do?pageId=${pageId}">
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="qtcode">交易码</label>
                          <div class="col-xs-3">
                             <input class="input-sm form-control" id="qtcode" name="qtcode" value="" type="text"/>
                          </div>
                          <label class="col-xs-1 control-label" for="qtname">交易名称</label>
                          <div class="col-xs-3">
 									<input class="input-sm form-control" name="qtname" id="qtname" value="" type="text" />
                          </div>
                          <div class="col-xs-3">
                          	 <button type="submit" class="btn btn-default btn-sm" >查询</button>                          
                          </div>
                       </div>
                       		<!-- </form> -->
                
   </div>
</div>
			<div>
				<input type="button" class="btn btn-default" value="创建交易参数" onclick="createTrade()" />
				<input type="button" class="btn btn-default" value="删除交易参数" onclick="deleteTrade()"/>
				<input type="button" class="btn btn-default" value="编辑交易参数" onclick="updateTrade()"/>
			</div>	
<macms:table dataListName="atpList">
	<macms:html id="ch" label="选择" innerHtml="<input type=\"radio\"  name=\"check\" value=\"15\">"></macms:html>
	<macms:text id="trade_id" label="交易标识"></macms:text>
    <macms:text id="page_ID" label="页面标识"></macms:text>
	<macms:text id="trade_code" label="交易码"></macms:text>
	<macms:text id="trade_name" label="交易名称"></macms:text>
	<macms:text id="trade_desc" label="交易描述"></macms:text>
	<macms:text id="trade_in_format" label="输入格式化"></macms:text>
	<macms:text id="trade_out_format" label="输出格式化"></macms:text>
</macms:table>


		<%@ include file="/page/page.jsp" %>
</form>
	<script language="javascript">
    var preRow = null;
    var tradeid="";
	$('tbody tr').bind('click', function() {

		var rowIndex = $(this).prevAll().length+1;
		if(rowIndex <1) return;
		
		if(preRow != null){
			preRow.removeClass("active");
		}
		$(this).addClass("active");
		preRow = $(this);
		
		tradeid=$(this).find("td").eq(1).text();
		// 行单击后事件(传入行号，应用ID,应用名称信息)
		rowClickAfter(rowIndex,
				$(this).find("td").eq(1).text(),
				$(this).find("td").eq(2).text());
		
	});
		
	</script>
</body>
</html>
